<template>
  <el-card>
    <el-descriptions class="margin-top" title="个人信息" :column="3" border>
      <template slot="extra">
        <el-button type="primary" size="small">操作</el-button>
      </template>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-user"></i>
          用户名
        </template>
        {{userInfo.name}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-mobile-phone"></i>
          手机号
        </template>
        {{userInfo.phone}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-female"></i>
          性别
        </template>
        {{userInfo.sex}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-coin"></i>
          积分
        </template>
        <el-tag size="small">{{userInfo.integral}}</el-tag>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-time"></i>
          创建时间
        </template>
        {{userInfo.createTime}}
      </el-descriptions-item>
    </el-descriptions>
  </el-card>
</template>

<script>
export default {
  name: "info",
  data(){
    return{
      userInfo:[],
      phone:this.$store.getters.get_user.phone,
    }
  },
  mounted() {
    this.getUserInfo();
  },
  methods:{
   async getUserInfo(){
     const res= await this.$axios.get('/api/user/findUser/'+this.phone);
     this.userInfo=res.data.content
     console.log(res)
   }
  }
}
</script>

<style scoped>

</style>